package algorithm.tree.binarytree.deep;

import algorithm.tree.binarytree.base.TreeNode;
import algorithm.tree.binarytree.inorder.InorderRecursion;

import java.util.function.Consumer;

public class ComputeTreeDeepRecursion {
    public static int getDeep(TreeNode node) {
        if (node == null) {
            return 0;
        } else {
            int rightDeep = getDeep(node.getRight());
            int leftDeep =  getDeep(node.getLeft());
            int deep = Math.max(leftDeep, rightDeep)+1;
            return deep;
        }
    }
}
